<template>
	<view class="content">

		<view class="bian" v-for="(item, idx) in lishi">
			<view class="dis" style="margin-bottom: 6rpx;">
				<view class="">{{item.member_name}}</view>
				<view class="" v-if="item.lessee_name != null">缴费时单位: {{item.lessee_name.name}}</view>
			</view>
			<view class="dis">
				<view class="">{{item.pay_time}}</view>
				<view style="color: red;">金额: {{item.Price}}</view>
			</view>
		</view>
		<view v-if="lishi.length < 1" style="color: gray; text-align: center; font-size: 30rpx; margin-top: 50rpx;">无更多数据</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				lishi: [],
			}
		},
		onLoad(option) {
			this.user = uni.getStorageSync("member");
			this.lishixinxi();
		},
		methods: {
			lishixinxi() {
				let self = this
				// 获取当前日期
				let today = new Date();
				// 获取年份
				let year = today.getFullYear();
				// 获取月份（注意月份是从0开始计数的，所以要加1）
				let month = today.getMonth() + 1;
				// 获取日期
				let day = today.getDate();
				let demo2Val = year + '/' + month + '/' + day
				// console.log('接口：',self.apiUrl);
				let url = '/hzj/get_order'
				let parm = {
					name: self.user.chinaname,
					pages: 1,
					price: 0,
					limit: 10000,
					sele_fee: null,
					uuid: self.user.uuid,
					time: {
						star_time: '2018/01/01',
						end_time: demo2Val
					},
					// token: '14d78037-08e3-49bf-b4ec-b8da61979af1'
					token: uni.getStorageSync("ttsxAuthToken")
				}
				self.$boya.NPost(url, parm, function(res) {
					let shuju = res.data.data
					// self.lishi = shuju
					for (var i = 0; i < shuju.length; i++) {
						if (shuju[i].fee_items == '医疗互助金') {
							self.lishi.push(shuju[i])
						}
					}
					console.log('lishi: ', self.lishi);
				})
			}
		}
	}
</script>

<style>
	.content {
		width: 90%;
		margin: 0 auto;
	}

	.bian {
		font-size: 30rpx;
		margin: 20rpx 0;
		padding: 10rpx 0;
		border-bottom: 1px solid rgba(0, 0, 0, 0.6);
	}

	.dis {
		display: flex;
		justify-content: space-between;
	}
</style>